-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:fix: add auto reconnect to service client #4012
Conversation
5ae4ffa
to
f2243bc
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4012 +/- ##
=============================================
- Coverage 16.87% 16.86% -0.01%
Complexity 10 10
=============================================
Files 1989 1987 -2
Lines 51791 51810 +19
Branches 4420 4421 +1
=============================================
Hits 8739 8739
- Misses 42648 42667 +19
Partials 404 404
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @riccardomodanese, I added a few questions.
commons/src/main/java/org/eclipse/kapua/commons/event/jms/JMSServiceEventBus.java
Show resolved
Hide resolved
client/security/src/main/java/org/eclipse/kapua/client/security/amqpclient/Client.java
Show resolved
Hide resolved
consumer.setMessageListener(clientMessageListener); | ||
producer = session.createProducer(session.createQueue(requestAddress)); | ||
clientMessageListener.init(session, producer); | ||
connectionStatus = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there not a way to read the connection status from one of these objects instead of managing it ourselves? Should it be set to false on exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately no. The javax.jms.Connection has no connect flag o isConnect method.
|
||
private void disconnect() throws JMSException { | ||
if (connection != null) { | ||
connection.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we set the connectionStatus here to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was relying on the ExceptionListener but you are right: it's better to set it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay let's add it in, then I'd be okay approving this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
bb46a1d
to
979de0d
Compare
979de0d
to
dbe3bb8
Compare
Signed-off-by: riccardomodanese <[email protected]>
dbe3bb8
to
fc8ef49
Compare
Brief description of the PR.
Added a connection retry when the conection is dropped.
Related Issue
fixes 4011
Description of the solution adopted
Like for the service event connection a connection retry was added. This is triggered, through the connection event listener, when the connection is dropped.
Screenshots
none
Any side note on the changes made
none